package com.tony.guice.Common;

import com.google.inject.Inject;
import com.google.inject.Provider;
import com.google.inject.Provides;

import java.lang.annotation.Annotation;
import java.sql.Connection;

/**
 * @version V1.0  </br>
 * @ClassName DatabaseTransactionLogProvider </br>
 * @Description TODO  </br>
 * @Author tonywang</br>
 * @DATE 2/28/2019 4:23 PM</br>
 */
public class DatabaseTransactionLogProvider implements Provider<TransactionLog> {
    @Inject  Connection connection;

    public DatabaseTransactionLogProvider(Connection connection) {
        this.connection = connection;
    }

    @Override
    public TransactionLog get() {
        DataTransactionLog log = new DataTransactionLog();
        log.setConnection(this.connection);
        return log;
    }
}
